import numpy as np

data = np.loadtxt('ex1data2.txt', delimiter=',')
# print(data)

x = data[:, :-1]
y = data[:, -1:]

from tensorflow.keras import losses, models, optimizers, layers
import matplotlib.pyplot as plt

model = models.Sequential()
model.add(layers.Dense(1, input_dim=(2)))

model.compile(optimizer=optimizers.Adam(0.05), loss=losses.mse)

history = model.fit(x, y, epochs=100)

loss = history.history['loss']
plt.plot(loss)
plt.show()
